package org.hackystat.iw.projectoverviewer.page.treemap;

/*
 * This code is highly inspired by Object Lab.
 * 
 * www.ObjectLab.co.uk
 */

import net.sf.jtreemap.swing.DefaultValue;

/**
 * Holds properties for the tree node.
 * 
 * @author Laurent DUTHEIL
 * @author Jianfei Liao
 * @author Nathan Britton 
 */
public class IWDefaultValue extends DefaultValue {
  private static final long serialVersionUID = 367321198951855282L;

  private double value;
  private String label;

  /**
   * Constructor.
   */
  public IWDefaultValue() {
    this.value = 0;
    this.label = "";
  }

  /**
   * Constructor.
   * 
   * @param value double value
   */
  public IWDefaultValue(final double value) {
    this.value = value;
    this.label = "";
  }

  /**
   * Gets the value.
   * 
   * @see net.sf.jtreemap.swing.Value#getValue()
   * @return The value.
   */
  @Override
  public double getValue() {
    return this.value;
  }

  /**
   * Gets the label.
   * 
   * @see net.sf.jtreemap.swing.Value#getLabel()
   * @return The label.
   */
  @Override
  public String getLabel() {
    return this.label;
  }

  /**
   * Sets the value.
   * 
   * @see net.sf.jtreemap.swing.Value#setValue(double)
   * @param value The value to set.
   */
  @Override
  public void setValue(final double value) {
    this.value = value;
  }

  /**
   * Sets the label.
   * 
   * @see net.sf.jtreemap.swing.Value#setLabel(java.lang.String)
   * @param newLabel The label to set.
   */
  @Override
  public void setLabel(final String newLabel) {
    this.label = newLabel;
  }
}
